package com.sqx.modules.tbOrders.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.tbOrders.entity.IllegalType;
import com.sqx.modules.tbOrders.service.IllegalTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/adminerrand")
@Api(value = "管理端-投诉类型", tags = {"管理端-投诉类型"})
public class IllegalTypeController {

    @Autowired
    private IllegalTypeService illegalTypeService;

    @ApiOperation("查（不分页）")
    @GetMapping(value = "selectIllegalTypeList")
    public Result selectIllegalTypeList(){
        return illegalTypeService.selectIllegalTypeList();
    }

    @ApiOperation("查（不分页）")
    @GetMapping(value = "selectIllegalTypePage")
    public Result selectIllegalTypePage(@ApiParam("页码") Integer page,
                                        @ApiParam("条数") Integer limit,
                                        @ApiParam("投诉类型实体") IllegalType illegalType){
        return illegalTypeService.selectIllegalTypePage(page, limit,illegalType);
    }

    @ApiOperation("增")
    @PostMapping(value = "insertIllegalType")
    public Result insertIllegalType(@ApiParam("投诉类型实体")@RequestBody IllegalType illegalType){
        return illegalTypeService.insertIllegalType(illegalType);
    }

    @ApiOperation("改")
    @PostMapping(value = "updateIllegalType")
    public Result updateIllegalType(@ApiParam("投诉类型实体")@RequestBody IllegalType illegalType){
        return illegalTypeService.updateIllegalType(illegalType);
    }

    @ApiOperation("删")
    @GetMapping(value = "deleteIllegalType")
    public Result deleteIllegalType(@ApiParam("投诉类型id")Long id){
        return illegalTypeService.deleteIllegalType(id);
    }

}
